package aash.catalog.views.label;

import aash.catalog.views.panel.PropertyPanel;
import java.awt.Color;
import javax.swing.JLabel;

/**
 * Property Label for Explorer View.
 * @author Aashintan
 */
public class PropertyLabel extends JLabel {
    /**
     * Default serial UID.
     */
    private static final long serialVersionUID = -1575588136051561375L;
    /**
     * X position of the label.
     */
    private final int posX = 20;
    /**
     * Width of the label.
     */
    private final int width = 60;
    /**
     * Height of the label.
     */
    private final int height = 20;
    /**
     * Step between each line.
     */
    private final int step = 40;
    /**
     * First line to use.
     */
    private final int firstLine = 30;

    /**
     * Class constructor.
     * @param stName of the label
     * @param pp the panel under the label
     * @param iLine of the label
     */
    public PropertyLabel(final String stName, final PropertyPanel pp, final int iLine) {
        super(stName + " :");
        setOpaque(true);
        setBackground(Color.RED);
        setBounds(pp.getX() + posX, pp.getY() + (iLine * step) + firstLine, width, height);
    }

    /**
     * Set the label name.
     * @param stName of the label
     */
    public final void setName(final String stName) {
        super.setName(stName + " :");
    }
}
